library _;

import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_app/Util/AssetUtils.dart';
import 'package:flutter_yfree/YFree.dart';
import 'package:scan/scan.dart';
import 'package:wechat_assets_picker/wechat_assets_picker.dart';

part 'controller.dart';

part 'view.dart';

class ScanQRCodePage extends YPage {
  ScanQRCodePage(this.onResult);

  void Function(String? result) onResult;
  String? result;

  var scanController = ScanController();
  var flash_on = false;

  @override
  void yOnCreate() {}

  @override
  void yOnDestory() {
    onResult(result);
  }

  @override
  bool ySafeAreaBottom() => false;

  @override
  Widget yBuild(BuildContext context) {
    return AnnotatedRegion(
      value: SystemUiOverlayStyle.light,
      child: Container(
        color: Colors.black,
        child: Stack(
          fit: StackFit.expand,
          alignment: Alignment.center,
          children: [
            view_scan(),
            view_top(),
            view_bottom(),
          ],
        ),
      ),
    );
  }
}
